home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / IntlResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  12.3 KB  |  353 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        IntlResources.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __INTLRESOURCES__
  18. #define __INTLRESOURCES__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if GENERATINGPOWERPC
  31. #pragma options align=mac68k
  32. #endif
  33.  
  34. #ifdef __CFM68K__
  35. #pragma lib_export on
  36. #endif
  37.  
  38.  
  39. enum {
  40. /* Bits in the itlcFlags byte */
  41.     itlcShowIcon                = 7,                            /*Show icon even if only one script*/
  42.     itlcDualCaret                = 6,                            /*Use dual caret for mixed direction text*/
  43. /* Bits in the itlcSysFlags word */
  44.     itlcSysDirection            = 15,                            /*System direction - left to right/right to left*/
  45. /* the NumberParts indices */
  46.     tokLeftQuote                = 1,
  47.     tokRightQuote                = 2,
  48.     tokLeadPlacer                = 3,
  49.     tokLeader                    = 4,
  50.     tokNonLeader                = 5,
  51.     tokZeroLead                    = 6,
  52.     tokPercent                    = 7,
  53.     tokPlusSign                    = 8,
  54.     tokMinusSign                = 9,
  55.     tokThousands                = 10,
  56.     tokSeparator                = 12,                            /*11 is a reserved field*/
  57.     tokEscape                    = 13,
  58.     tokDecPoint                    = 14,
  59.     tokEPlus                    = 15,
  60.     tokEMinus                    = 16,
  61.     tokMaxSymbols                = 31,
  62.     curNumberPartsVersion        = 1                                /*current version of NumberParts record*/
  63. };
  64.  
  65. enum {
  66.     currSymLead                    = 16,
  67.     currNegSym                    = 32,
  68.     currTrailingZ                = 64,
  69.     currLeadingZ                = 128
  70. };
  71.  
  72. enum {
  73.     mdy,
  74.     dmy,
  75.     ymd,
  76.     myd,
  77.     dym,
  78.     ydm
  79. };
  80.  
  81. typedef SInt8 DateOrders;
  82.  
  83.  
  84. enum {
  85.     timeCycle24                    = 0,                            /*time sequence 0:00 - 23:59*/
  86.     timeCycleZero                = 1,                            /*time sequence 0:00-11:59, 0:00 - 11:59*/
  87.     timeCycle12                    = 255,                            /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
  88.     zeroCycle                    = 1,                            /*old name for timeCycleZero*/
  89.     longDay                        = 0,                            /*day of the month*/
  90.     longWeek                    = 1,                            /*day of the week*/
  91.     longMonth                    = 2,                            /*month of the year*/
  92.     longYear                    = 3,                            /*year*/
  93.     supDay                        = 1,                            /*suppress day of month*/
  94.     supWeek                        = 2,                            /*suppress day of week*/
  95.     supMonth                    = 4,                            /*suppress month*/
  96.     supYear                        = 8,                            /*suppress year*/
  97.     dayLdingZ                    = 32,
  98.     mntLdingZ                    = 64,
  99.     century                        = 128,
  100.     secLeadingZ                    = 32,
  101.     minLeadingZ                    = 64,
  102.     hrLeadingZ                    = 128
  103. };
  104.  
  105. /* move OffsetTable to QuickdrawText */
  106. struct Intl0Rec {
  107.     char                            decimalPt;                    /*decimal point character*/
  108.     char                            thousSep;                    /*thousands separator character*/
  109.     char                            listSep;                    /*list separator character*/
  110.     char                            currSym1;                    /*currency symbol*/
  111.     char                            currSym2;
  112.     char                            currSym3;
  113.     UInt8                            currFmt;                    /*currency format flags*/
  114.     UInt8                            dateOrder;                    /*order of short date elements: mdy, dmy, etc.*/
  115.     UInt8                            shrtDateFmt;                /*format flags for each short date element*/
  116.     char                            dateSep;                    /*date separator character*/
  117.     UInt8                            timeCycle;                    /*specifies time cycle: 0..23, 1..12, or 0..11*/
  118.     UInt8                            timeFmt;                    /*format flags for each time element*/
  119.     char                            mornStr[4];                    /*trailing string for AM if 12-hour cycle*/
  120.     char                            eveStr[4];                    /*trailing string for PM if 12-hour cycle*/
  121.     char                            timeSep;                    /*time separator character*/
  122.     char                            time1Suff;                    /*trailing string for AM if 24-hour cycle*/
  123.     char                            time2Suff;
  124.     char                            time3Suff;
  125.     char                            time4Suff;
  126.     char                            time5Suff;                    /*trailing string for PM if 24-hour cycle*/
  127.     char                            time6Suff;
  128.     char                            time7Suff;
  129.     char                            time8Suff;
  130.     UInt8                            metricSys;                    /*255 if metric, 0 if inches etc.*/
  131.     short                            intl0Vers;                    /*region code (hi byte) and version (lo byte)*/
  132. };
  133. typedef struct Intl0Rec Intl0Rec;
  134.  
  135. typedef Intl0Rec *Intl0Ptr, **Intl0Hndl;
  136.  
  137. struct Intl1Rec {
  138.     Str15                            days[7];                    /*day names*/
  139.     Str15                            months[12];                    /*month names*/
  140.     UInt8                            suppressDay;                /*255 for no day, or flags to suppress any element*/
  141.     UInt8                            lngDateFmt;                    /*order of long date elements*/
  142.     UInt8                            dayLeading0;                /*255 for leading 0 in day number*/
  143.     UInt8                            abbrLen;                    /*length for abbreviating names*/
  144.     char                            st0[4];                        /*separator strings for long date format*/
  145.     char                            st1[4];
  146.     char                            st2[4];
  147.     char                            st3[4];
  148.     char                            st4[4];
  149.     short                            intl1Vers;                    /*region code (hi byte) and version (lo byte)*/
  150.     short                            localRtn[1];                /*now a flag for opt extension*/
  151. };
  152. typedef struct Intl1Rec Intl1Rec;
  153.  
  154. typedef Intl1Rec *Intl1Ptr, **Intl1Hndl;
  155.  
  156. /*fields for optional itl1 extension*/
  157. struct Itl1ExtRec {
  158.     Intl1Rec                        base;                        /*un-extended Intl1Rec*/
  159.     short                            version;
  160.     short                            format;
  161.     short                            calendarCode;                /*calendar code for this itl1 resource*/
  162.     long                            extraDaysTableOffset;        /*offset in itl1 to extra days table*/
  163.     long                            extraDaysTableLength;        /*length of extra days table*/
  164.     long                            extraMonthsTableOffset;        /*offset in itl1 to extra months table*/
  165.     long                            extraMonthsTableLength;        /*length of extra months table*/
  166.     long                            abbrevDaysTableOffset;        /*offset in itl1 to abbrev days table*/
  167.     long                            abbrevDaysTableLength;        /*length of abbrev days table*/
  168.     long                            abbrevMonthsTableOffset;    /*offset in itl1 to abbrev months table*/
  169.     long                            abbrevMonthsTableLength;    /*length of abbrev months table*/
  170.     long                            extraSepsTableOffset;        /*offset in itl1 to extra seps table*/
  171.     long                            extraSepsTableLength;        /*length of extra seps table*/
  172.     short                            tables[1];                    /*now a flag for opt extension*/
  173. };
  174. typedef struct Itl1ExtRec Itl1ExtRec;
  175.  
  176. struct UntokenTable {
  177.     short                            len;
  178.     short                            lastToken;
  179.     short                            index[256];                    /*index table; last = lastToken*/
  180. };
  181. typedef struct UntokenTable UntokenTable;
  182.  
  183. typedef UntokenTable *UntokenTablePtr, **UntokenTableHandle;
  184.  
  185. union WideChar {
  186.     char                            a[2];                        /*0 is the high order character*/
  187.     short                            b;
  188. };
  189. typedef union WideChar WideChar;
  190.  
  191. struct WideCharArr {
  192.     short                            size;
  193.     WideChar                        data[10];
  194. };
  195. typedef struct WideCharArr WideCharArr;
  196.  
  197. struct NumberParts {
  198.     short                            version;
  199.     WideChar                        data[31];                    /*index by [tokLeftQuote..tokMaxSymbols]*/
  200.     WideCharArr                        pePlus;
  201.     WideCharArr                        peMinus;
  202.     WideCharArr                        peMinusPlus;
  203.     WideCharArr                        altNumTable;
  204.     char                            reserved[20];
  205. };
  206. typedef struct NumberParts NumberParts;
  207.  
  208. typedef NumberParts *NumberPartsPtr;
  209.  
  210. struct Itl4Rec {
  211.     short                            flags;                        /*reserved*/
  212.     long                            resourceType;                /*contains 'itl4'*/
  213.     short                            resourceNum;                /*resource ID*/
  214.     short                            version;                    /*version number*/
  215.     long                            resHeader1;                    /*reserved*/
  216.     long                            resHeader2;                    /*reserved*/
  217.     short                            numTables;                    /*number of tables, one-based*/
  218.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  219.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  220.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  221.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  222.     long                            defPartsOffset;                /*offset to default number parts table*/
  223.     long                            resOffset6;                    /*reserved*/
  224.     long                            resOffset7;                    /*reserved*/
  225.     long                            resOffset8;                    /*reserved*/
  226. };
  227. typedef struct Itl4Rec Itl4Rec;
  228.  
  229. typedef Itl4Rec *Itl4Ptr, **Itl4Handle;
  230.  
  231. /* New NItl4Rec for System 7.0: */
  232. struct NItl4Rec {
  233.     short                            flags;                        /*reserved*/
  234.     long                            resourceType;                /*contains 'itl4'*/
  235.     short                            resourceNum;                /*resource ID*/
  236.     short                            version;                    /*version number*/
  237.     short                            format;                        /*format code*/
  238.     short                            resHeader;                    /*reserved*/
  239.     long                            resHeader2;                    /*reserved*/
  240.     short                            numTables;                    /*number of tables, one-based*/
  241.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  242.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  243.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  244.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  245.     long                            defPartsOffset;                /*offset to default number parts table*/
  246.     long                            whtSpListOffset;            /*offset to white space code list*/
  247.     long                            resOffset7;                    /*reserved*/
  248.     long                            resOffset8;                    /*reserved*/
  249.     short                            resLength1;                    /*reserved*/
  250.     short                            resLength2;                    /*reserved*/
  251.     short                            resLength3;                    /*reserved*/
  252.     short                            unTokenLength;                /*length of untoken table*/
  253.     short                            defPartsLength;                /*length of default number parts table*/
  254.     short                            whtSpListLength;            /*length of white space code list*/
  255.     short                            resLength7;                    /*reserved*/
  256.     short                            resLength8;                    /*reserved*/
  257. };
  258. typedef struct NItl4Rec NItl4Rec;
  259.  
  260. typedef NItl4Rec *NItl4Ptr, **NItl4Handle;
  261.  
  262. struct TableDirectoryRecord {
  263.     OSType                            tableSignature;                /*4 byte long table name */
  264.     unsigned long                    reserved;                    /*Reserved for internal use */
  265.     unsigned long                    tableStartOffset;            /*Table start offset in byte*/
  266.     unsigned long                    tableSize;                    /*Table size in byte*/
  267. };
  268. typedef struct TableDirectoryRecord TableDirectoryRecord;
  269.  
  270. struct Itl5Record {
  271.     Fixed                            versionNumber;                /*itl5 resource version number */
  272.     unsigned short                    numberOfTables;                /*Number of tables it contains */
  273.     unsigned short                    reserved[3];                /*Reserved for internal use */
  274.     TableDirectoryRecord            tableDirectory[1];            /*Table directory records */
  275. };
  276. typedef struct Itl5Record Itl5Record;
  277.  
  278. struct RuleBasedTrslRecord {
  279.     short                            sourceType;                    /*Transliterate target type for the LHS of the rule */
  280.     short                            targetType;                    /*Transliterate target type for the RHS of the rule */
  281.     short                            formatNumber;                /*Transliterate resource format number */
  282.     short                            propertyFlag;                /*Transliterate property flags */
  283.     short                            numberOfRules;                /*Number of rules following this field */
  284. };
  285. typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
  286.  
  287. struct ItlcRecord {
  288.     short                            itlcSystem;                    /*default system script*/
  289.     short                            itlcReserved;                /*reserved*/
  290.     SInt8                            itlcFontForce;                /*default font force flag*/
  291.     SInt8                            itlcIntlForce;                /*default intl force flag*/
  292.     SInt8                            itlcOldKybd;                /*MacPlus intl keybd flag*/
  293.     SInt8                            itlcFlags;                    /*general flags*/
  294.     short                            itlcIconOffset;                /*keyboard icon offset; not used in 7.0*/
  295.     SInt8                            itlcIconSide;                /*keyboard icon side; not used in 7.0*/
  296.     SInt8                            itlcIconRsvd;                /*rsvd for other icon info*/
  297.     short                            itlcRegionCode;                /*preferred verXxx code*/
  298.     short                            itlcSysFlags;                /*flags for setting system globals*/
  299.     SInt8                            itlcReserved4[32];            /*for future use*/
  300. };
  301. typedef struct ItlcRecord ItlcRecord;
  302.  
  303. struct ItlbRecord {
  304.     short                            itlbNumber;                    /*itl0 id number*/
  305.     short                            itlbDate;                    /*itl1 id number*/
  306.     short                            itlbSort;                    /*itl2 id number*/
  307.     short                            itlbFlags;                    /*Script flags*/
  308.     short                            itlbToken;                    /*itl4 id number*/
  309.     short                            itlbEncoding;                /*itl5 ID # (optional; char encoding)*/
  310.     short                            itlbLang;                    /*current language for script */
  311.     SInt8                            itlbNumRep;                    /*number representation code*/
  312.     SInt8                            itlbDateRep;                /*date representation code */
  313.     short                            itlbKeys;                    /*KCHR id number*/
  314.     short                            itlbIcon;                    /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
  315. };
  316. typedef struct ItlbRecord ItlbRecord;
  317.  
  318. /* New ItlbExtRecord structure for System 7.0 */
  319. struct ItlbExtRecord {
  320.     ItlbRecord                        base;                        /*un-extended ItlbRecord*/
  321.     long                            itlbLocalSize;                /*size of script's local record*/
  322.     short                            itlbMonoFond;                /*default monospace FOND ID*/
  323.     short                            itlbMonoSize;                /*default monospace font size*/
  324.     short                            itlbPrefFond;                /*preferred FOND ID*/
  325.     short                            itlbPrefSize;                /*preferred font size*/
  326.     short                            itlbSmallFond;                /*default small FOND ID*/
  327.     short                            itlbSmallSize;                /*default small font size*/
  328.     short                            itlbSysFond;                /*default system FOND ID*/
  329.     short                            itlbSysSize;                /*default system font size*/
  330.     short                            itlbAppFond;                /*default application FOND ID*/
  331.     short                            itlbAppSize;                /*default application font size*/
  332.     short                            itlbHelpFond;                /*default Help Mgr FOND ID*/
  333.     short                            itlbHelpSize;                /*default Help Mgr font size*/
  334.     Style                            itlbValidStyles;            /*set of valid styles for script*/
  335.     Style                            itlbAliasStyle;                /*style (set) to mark aliases*/
  336. };
  337. typedef struct ItlbExtRecord ItlbExtRecord;
  338.  
  339.  
  340. #ifdef __CFM68K__
  341. #pragma lib_export off
  342. #endif
  343.  
  344. #if GENERATINGPOWERPC
  345. #pragma options align=reset
  346. #endif
  347.  
  348. #ifdef __cplusplus
  349. }
  350. #endif
  351.  
  352. #endif /* __INTLRESOURCES__ */
  353.